<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <script src="./echarts.min.js"></script>
  </head>
  <body>
    <div id="main" style="width: 800px; height: 400px"></div>
    <script>
      var myChart = echarts.init(document.querySelector("#main"));
      const option = {
        title: {},
        xAxis: {
          type: "category",
          data: [
            "一月",
            "二月",
            "三月",
            "四月",
            "五月",
            "六月",
            "七月",
            "八月",
            "九月",
            "十月",
            "十一月",
            "十二月",
          ],
          axisTick: {
            alignWithLabel: true,
          },
          axisLine: {
            lineStyle: {
              type: "dashed",
              color: "#999",
            },
          },
        },
        yAxis: {
          type: "value",
          splitLine: {
            lineStyle: {
              type: "dashed",
            },
          },
        },
        tooltip: {
          trigger: "axis",
        },
        series: [
          {
            data: [
              12843, 18342, 13584, 14658, 12905, 13300, 15202, 12843, 18342,
              13584, 14658, 12905,
            ],
            type: "bar",
            smooth: true,
          },
          {
            data: [
              12843, 18342, 13584, 14658, 12905, 13300, 15202, 12843, 18342,
              13584, 14658, 12905,
            ],
            type: "bar",
            smooth: true,
            symbolSize: "10",
          },
        ],
        color: [
          {
            type: "linear",
            x: 0,
            y: 0,
            x2: 0,
            y2: 1,
            colorStops: [
              {
                offset: 0,
                color: "#43d4a1", // 0% 处的颜色
              },
              {
                offset: 1,
                color: "#cff5e7", // 100% 处的颜色
              },
            ],
            global: false, // 缺省为 false
          },
          {
            type: "linear",
            x: 0,
            y: 0,
            x2: 0,
            y2: 1,
            colorStops: [
              {
                offset: 0,
                color: "#4fa2ee", // 0% 处的颜色
              },
              {
                offset: 1,
                color: "#d1e6fa", // 100% 处的颜色
              },
            ],
            global: false, // 缺省为 false
          },
        ],
      };
      // 使用刚指定的配置项和数据显示图表。
      myChart.setOption(option);
    </script>
  </body>
</html>
